<template>
  <div id="app">
    <el-container style="width:100%;height: 100%;background: skyblue">
      <el-aside width="200px" style="background-color: rgb(84, 92, 100)">
        <div style="height:60px;color: whitesmoke">
          logo区域
        </div>
<!--        <el-menu>-->
<!--          <div>左侧菜单。。。。</div>-->
<!--        </el-menu>-->
        <el-menu :router="true" :default-active="activeIndex2" class="el-menu-demo" mode="horizontal"
                 background-color="#545c64" text-color="#fff" active-text-color="#ffd04b" @select="handleSelect">
          <el-menu-item index="/">主应用</el-menu-item>
          <el-menu-item index="/qiankunChild/myAbout">子应用about应用</el-menu-item>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="height:60px;text-align: right; font-size: 12px;background: sandybrown">
          头部区域代码。。。
        </el-header>

        <el-main style="padding: 0;margin: 0">
          <!-- 主应用的渲染区域，用于挂载主应用触发的组件 -->
          <router-view v-show="$route.name"></router-view>
          <!-- 子应用渲染的区域，用于挂载Vue或者React子应用节点 -->
          <!--如果获取不了$route.name，说明访问的不是主应用路由，对应就是加载子应用。单独在container容器中加载我们的子应用-->
          <div v-if="!$route.name" id="childDemo">hhh </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>

export default {
  name: 'App',
  data(){
    return{
      activeIndex2:'/'
    }
  },
  methods:{
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    }
  }
}
</script>

<style>
html,body{
  margin: 0 !important;
  padding: 0 !important;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  width: 100vw;
  height: 100vh;
}
</style>
